package com.gandong8.trace.domain.common;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageData<T> implements Serializable {
    private Integer page;
    private Integer pageSize;
    private Long totalPages;
    private Long totalRecords;
    private List<T> dataList;

    public PageData( Integer page, Integer pageSize) {
        if(page ==null || page < 1) {
            this.page = 1;
        } else {
            this.page = page;
        }
        if(pageSize == null) {
            this.pageSize = 20;
        } else {
            this.pageSize = pageSize;
        }
    }
}
